//package com.runa.monitor.platinterface.backwork.util;
//
//import com.runa.monitor.comm.dto.ResultMessage;
//import com.runa.monitor.platinterface.config.RabbitConfig;
//import com.runa.persistence.SerializeUtil;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.Map;
//
///**
// * rabbitmq操作工具类，根据特定功能定义操作方法，统一使用
// * @author zhuj
// */
//@Component("RabbitMqUtil")
//public class RabbitMqUtil {
//
//    private static final Logger logger = LoggerFactory.getLogger(RabbitMqUtil.class);
//
//    @Resource
//    private RabbitTemplate template;
//
//    public void sendDataToHeatNet(Map data) {
//        if (template != null) {
//            template.convertAndSend(RabbitConfig.ExchangeName, RabbitConfig.RoutingKey2, data);
//            logger.info("To HeatNet Queue -- Msg: {}", data);
//        }
//    }
//
//    public void sendMqttDataToHeatNet(Object data) {
//        if (template != null) {
//            template.convertAndSend(RabbitConfig.ExchangeName, RabbitConfig.RoutingKey6, data);
//            logger.info("To HeatNet Queue -- Msg: {}", data);
//        }
//    }
//
//    public void sendDataToMeter(ResultMessage message) {
//        if (template != null) {
//            template.convertAndSend(RabbitConfig.ExchangeName, RabbitConfig.RoutingKey4, SerializeUtil.obj2Bytes(message));
//            logger.info("To Meter Queue -- Msg: {}", SerializeUtil.obj2json(message));
//        }
//    }
//
//    public void sendDataToBalance(ResultMessage message) {
//        if (template != null) {
//            template.convertAndSend(RabbitConfig.ExchangeName, RabbitConfig.RoutingKey5, SerializeUtil.obj2Bytes(message));
//            logger.info("To Balance Queue -- Msg: {}", SerializeUtil.obj2json(message));
//        }
//    }
//
////    public static void main(String[] args) {
////        NetEquModel netEquModel = newComm NetEquModel();
////        netEquModel.setTimeout(114);
////        netEquModel.setMeterNo("ffff");
////        netEquModel.setSerial("r23525325");
////        System.out.println(SerializeUtil.obj2json(netEquModel));
////        System.out.println(JSON.toJSONString(netEquModel));
////    }
//
//
////    public void sendMqttArchiveDataToHeatNet(Object data) {
////        if (template != null) {
////            template.convertAndSend(RabbitConfig.ExchangeName, RabbitConfig.RoutingKey7, data);
////            logger.info("To HeatNet Queue -- Msg: {}", data);
////        }
////    }
//
//}
